# ！ /usr/bin/python3
# -*- coding:utf-8 -*-
# @Author:Peng Cao
# @File: 操作xls文件.py
# @Software: PyCharm
import xlrd
from xlutils.copy import copy

# 读取
# data = xlrd.open_workbook("./case_data.xls")
# name = data.sheet_names()  # 获取表名称
# table = data.sheet_by_index(0)
# rows = table.nrows
# print(rows)  # 获取行数
# cols = table.ncols
# print(cols)  # 获取列数
# for nrow in range(1, table.nrows):
#     value = table.row_values(nrow)
#     print(value)

# 写入
data = xlrd.open_workbook('../wr2.xls')
data_cp = copy(data)
table_cp = data_cp.get_sheet(0)
table_cp.write(0, 0, "新内容888888888888")
data_cp.save("./wr2.xls")
